package com.oocl.o2o.admin.util;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import org.apache.activemq.util.ByteArrayInputStream;

public class FileUtil {
	
	
	public static void writeFile(byte[] content, String path) throws IOException{
		OutputStream out = new FileOutputStream(path);
		InputStream in = new ByteArrayInputStream(content);
		byte[] buff = new byte[1024];
		int len = 0;
		while((len = in.read(buff)) != -1){
			out.write(buff,0,len);
		}
		out.close();
		in.close();
	}
	
//	public static void main(String[] args) throws IOException {
//		byte[] b = "HELLO".getBytes();
//		writeFile(b, "d:\\a.txt");
//	}
}
